# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: FaziBear <fazibear@gmail.com>

pkgname=jruby
pkgver=9.4.5.0
pkgrel=1
pkgdesc="100% pure-Java implementation of the Ruby programming language"
url="https://www.jruby.org/"
arch=(any)
license=(
  '(EPL-2.0 OR GPL-2.0-only OR LGPL-2.1-only) AND BSD-3-Clause AND MIT AND MIT-0 AND Apache-2.0 AND Ruby'
)
options=(!strip)
source=(https://repo1.maven.org/maven2/org/jruby/jruby-dist/$pkgver/jruby-dist-$pkgver-bin.tar.gz)
md5sums=('09c6fceb38d6c086af2e4d5f21f9fe65')
sha1sums=('9f2d039c975659a641d5002d0999aec73b963260')
sha256sums=('a40f78c4641ccc86752e16b2da247fd6bc9fbcf9a4864cf1be36f7ff7b35684c')

prepare() {
  cd jruby-$pkgver
  rm -rv bin/*.{bat,dll,exe} lib/jni/{Darwin,*-SunOS,*-Windows,*-AIX,*-*BSD}
  chmod -cR g-w .
}

package() {
  depends=(java-runtime-headless bash)

  mkdir -p "$pkgdir"/{opt,usr/bin,usr/share/licenses/$pkgname}
  cp -a jruby-$pkgver "$pkgdir/opt/jruby"
  ln -srt "$pkgdir/usr/bin" \
    "$pkgdir"/opt/jruby/bin/j{irb,irb_swing,gem,ruby,rubyc}
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 jruby-$pkgver/COPYING
}

# vim:set sw=2 sts=-1 et:
